﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace Elvex
{
    public class HUDCamera : MonoBehaviour
    {
        Camera m_camera;

        public static Camera Camera { get { return m_self.m_camera; } }

        private static HUDCamera m_self { get; set; } = null;

        private void Awake()
        {
            m_self = this;
            m_camera = GetComponent<Camera>();
            DontDestroyOnLoad(gameObject);
        }

        public static Vector3 WorldToScreenPoint(Vector3 position)
        {
            return m_self.m_camera.WorldToScreenPoint(position);
        }

        public static Vector3 ScreenToWorldPoint(Vector3 position)
        {
            return m_self.m_camera.ScreenToWorldPoint(position);
        }
    }
}
